View Javadoc

1   /*
2    * Copyright (c) 2004-2005, University Health Network.  All rights reserved. Distributed under the BSD 
3    * license (see http://opensource.org/licenses/bsd-license.php).
4    *  
5    * Created on 5-Jan-2005
6    */
7   package ca.uhn.cache.internal;
8   
9   import java.util.NoSuchElementException;
10  
11  
12  /***
13   * Iterator through a list of <code>IChunk</code>s. 
14   * 
15   * @author <a href="mailto:bryan.tripp@uhn.on.ca">Bryan Tripp</a>
16   * @version $Revision: 1.1 $ updated on $Date: 2005/01/24 22:53:27 $ by $Author: bryan_tripp $
17   */
18  public interface IChunkIterator {
19      
20      /***
21       * @return true iff there is another chunk; implicitly calls close() 
22       *      if false.   
23       */
24      public boolean hasNext();
25      
26      /***
27       * @return the next IChunk 
28       * @throws NoSuchElementException if called when hasNext() returns false 
29       * TODO: throw same exception as IChunkStore (none currently) on error 
30       */
31      public IChunk next() throws NoSuchElementException;
32  
33      /***
34       * Releases any resources held by this iterator. 
35       */
36      public void close();
37      
38  }